package com.joysuch.wwyt.bp.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.joysuch.wwyt.bp.bean.investigate.TaskSummarySearchBean;
import com.joysuch.wwyt.bp.bean.investigate.vo.AppInvestigateSummaryVo;
import com.joysuch.wwyt.bp.bean.vo.RiskPointSnapshotVo;
import com.joysuch.wwyt.bp.entity.BpInvestigateTaskSummary;
import com.joysuch.wwyt.bp.entity.bean.RecordSearchBean;
import com.joysuch.wwyt.bp.entity.dto.BpInvestigateTaskSummaryDto;
import com.joysuch.wwyt.bp.entity.dto.CheckRecordDto;
import com.joysuch.wwyt.bp.entity.vo.AppCheckTaskVo;
import com.joysuch.wwyt.bp.entity.vo.CheckRecordVo;
import com.joysuch.wwyt.bp.entity.vo.NfcCheckTaskVO;
import com.joysuch.wwyt.core.bean.SimpleSelectListBean;
import com.joysuch.wwyt.core.common.ajax.ResultBean;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author zr
 * @since 2021-09-16
 */
public interface BpInvestigateTaskSummaryService extends IService<BpInvestigateTaskSummary> {

    /**
     * 今日任务汇总
     * @param bean
     * @return
     */
    IPage<BpInvestigateTaskSummaryDto> findTodaySummaryPaging(TaskSummarySearchBean bean);


    IPage<AppInvestigateSummaryVo> findTodaySummaryPagingApp(TaskSummarySearchBean bean);



    BpInvestigateTaskSummary findByUserIdAndCheckDate(Long userId, Date checkDate);

    ResultBean findRecordSummaryByPaging(TaskSummarySearchBean bean, boolean onlySelf);

    Page findHistorySummaryPage(TaskSummarySearchBean bean);

    //根据任务记录的汇总id删除
    void deleteSummaryById(Long summaryId);

    ResultBean getRecordByTaskSummaryId(RecordSearchBean recordSearchBean);

    ResultBean getHistoryRecordPage(RecordSearchBean recordSearchBean);

    List<CheckRecordVo> convertDtoToVoBatch(List<CheckRecordDto> recordDtos, boolean isHistory);

    void uncheckConvert(List<CheckRecordDto> recordDtos);

    List<SimpleSelectListBean> getSubscript();

    List<AppCheckTaskVo> getAppSubTimeTask(RecordSearchBean recordSearchBean);

    List<AppCheckTaskVo.PointTaskGroup> getTaskIdsById(List<Long> taskIds);

    List<RiskPointSnapshotVo> getRiskPointSnapshot(RecordSearchBean searchBean);

    BpInvestigateTaskSummary findRecordBySummaryId(Long summaryId);

    Map<String,Long> getTaskSummaryCount(TaskSummarySearchBean bean);

    int updateExceptionProcessResultBatchById(String status, List<Long> ids);

    /**
     * 异常处理流程开始后调用此方法，更新summary的异常处理状态
     * @param itemId
     */
    void updateSummaryRepairStatusV2(Long itemId);

    void moveSummary(Date border);

    void moveTaskSub(List<Long> taskIds);

    Map<String, Object> moveDataTest(int count);

    NfcCheckTaskVO getNfcTaskGroupApp(String nfcCode);

    NfcCheckTaskVO getQrCodeTaskGroupApp(String code);

    void doMoveHisTaskSub(List<Long> singleIds, String year);

    void doMoveHisSummary(List<Long> singleIds, String key);

}
